#!/usr/bin/bash
echo "Welcome to the DE installation script!"

de_list=(gnome kde hyprland xfce)

echo "There are serveral DE available for you to choose from:"
echo "@{de_list[*]}"

de=none
while [ $de != gnome ] && [ $de != kde ] && [ $de != xfce ] && [ $de != hyprland ]; do
	echo "Please choose your favourite DE :"
	read de
done

echo -e "\e[36mNow, we are going to install $de\e[0m"

case $de in
	(gnome)
		sudo pacman -S gnome
		sudo systemctl enable gdm
		;;
	(kde)
		sudo pacman -S plasma dolphin konsole
		sudo systemctl enable sddm
		;;
	(xfce)
		sudo pacman -S xfce4 sddm
		sudo systemctl enable sddm
		;;
	(hyprland)
		sudo pacman -S hyprland sddm
		sudo systemctl enable sddm
		echo ""
		echo "Do you want to config the hyprland ? (yes/[no])"
		read is_hypr
		if [ $is_hypr == "yes" ]; then
			git clone https://gitee.com/blake-john/hyprland.git
			cd hyprland
			./setup_hyprland.sh
		fi
		;;

esac

echo -e "\e[32mSuccessfully install $de !\e[0m"
echo "Have a good time with $de"
